<!DOCTYPE html>
<html lang="zh">

<head>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>页面</title>
    <script src="https://pinzafile.oss-cn-shanghai.aliyuncs.com/vue-element/loading.js"></script>
    <link href="https://pinzafile.oss-cn-shanghai.aliyuncs.com/vue-element/lib/theme-chalk/index.css" rel="stylesheet">
</head>
<style>
    .spacingFoot {
        height: 50px;
    }

    .spacing {
        margin-bottom: -36px;
    }
    .el-table .danger-row {
        color: #F56C6C;
    }
</style>
<body>
<div id="app">
    <el-container>
        <el-main>
        <el-header>
            <el-breadcrumb separator-class="el-icon-arrow-right">
                <el-breadcrumb-item :to="{ path: '/' }">PM订单管理</el-breadcrumb-item>
                <el-breadcrumb-item>订单列表</el-breadcrumb-item>
                <el-breadcrumb-item>订单查看</el-breadcrumb-item>
            </el-breadcrumb>
        </el-header>
            <el-form label-width="120px">
                <el-card class="box-card">
                    <span style="color:#43515a;font-family: PingFang SC">订单信息</span>
                    <el-row>
                    <#--<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" class="spacing">-->
                    <#--<h5 style="color: #909399">订单名称：<span style="color:#527c94cc">{{order_name}}</span></h5>-->
                    <#--</el-col>-->
                        <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" class="spacing">
                            <h5 v-if="surface_id == ''" style="color: #F56C6C">订单编号：该必填字段未填，无法导入<h5 v-else style="color: #909399">订单编号：<span style="color:#527c94cc">{{surface_id}}</span></h5>
                        </el-col>
                        <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" class="spacing">
                            <h5 style="color: #909399">创建时间：<span style="color:#527c94cc">{{crtTime}}</span></h5>
                        </el-col>
                    <#--<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" class="spacing">-->
                    <#--<h5 style="color: #909399">订单总额：<span style="color:#527c94cc">{{price}}</span></h5>-->
                    <#--</el-col>-->
                        <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" class="spacing">
                            <h5 v-if="project_name == ''" style="color: #F56C6C">项目名称：该必填字段未填，无法导入<h5 v-else style="color: #909399">项目名称：<span style="color:#527c94cc">{{project_name}}</span></h5>
                        </el-col>
                        <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" class="spacing">
                            <h5 v-if="supplierContact == ''" style="color: #F56C6C">供应商联系人：该必填字段未填，无法导入<h5 v-else style="color: #909399">供应商联系人：<span style="color:#527c94cc">{{supplierContact}}</span></h5>
                        </el-col>
                        <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" class="spacing">
                            <h5 v-if="buyer == ''" style="color: #F56C6C">客户联系人：该必填字段未填，无法导入<h5 v-else style="color: #909399">客户联系人：<span style="color:#527c94cc">{{buyer}}</span></h5>
                        </el-col>
                        <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" class="spacing">
                            <h5 v-if="organizationName == ''" style="color: #F56C6C">客户名称：该必填字段未填，无法导入<h5 v-else style="color: #909399">客户名称：<span style="color:#527c94cc">{{organizationName}}</span>
                            </h5>
                        </el-col>
                        <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" class="spacing">
                            <h5 style="color: #909399">备注：<span style="color:#527c94cc" v-if="remark != 'null'">{{remark}}</span><span
                                    style="color:#527c94cc" v-else>未填写</span></h5>
                        </el-col>
                    </el-row>
                </el-card>
                <el-card class="box-card">
                    <span style="color:#43515a;font-family: PingFang SC">收货信息</span>
                    <el-row :gutter="20">
                        <el-col :span="8" class="spacing">
                            <h5 v-if="consignee_information == ''" style="color: #F56C6C">收货人联系方式：该必填字段未填，无法导入<h5 v-else style="color: #909399">收货人联系方式：<span
                                    style="color:#527c94cc">{{consignee_information}}</span></h5>
                        </el-col>
                    </el-row>
                    <el-row :gutter="20">
                        <el-col :span="8" class="spacing">
                            <h5 v-if="consignee_address == ''" style="color: #F56C6C">收货地址：该必填字段未填，无法导入<h5 v-else style="color: #909399">收货地址：<span style="color:#527c94cc">{{consignee_address}}</span>
                            </h5>
                        </el-col>
                    </el-row>
                <#--<el-row :gutter="20">-->
                <#--<el-col :span="8" class="spacing">-->
                <#--<h5 style="color: #909399">联系电话：<span style="color:#527c94cc" v-if="contact != 'null'">{{contact}}</span><span-->
                <#--style="color:#527c94cc" v-else>未填写</span></h5>-->
                <#--</el-col>-->
                <#--</el-row>-->
                </el-card>
            <#--<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" class="spacing">-->
            <#--<el-form-item label="订单名称">-->
            <#--<el-input v-model="purchaseOrder.purchaseOrderName"></el-input>-->
            <#--</el-form-item>-->
            <#--</el-col>-->
            <#--</el-row>-->
            <#--<el-row>-->
            <#--<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">-->
            <#--<el-form-item label="项目名称">-->
            <#--<el-input :disabled="true" v-model="project_name"></el-input>-->
            <#--</el-form-item>-->
            <#--</el-col>-->
            <#--<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">-->
            <#--<el-form-item label="订单时间">-->
            <#--<el-input v-model="crtTime" :disabled="true"></el-input>-->
            <#--</el-form-item>-->
            <#--</el-col>-->
            <#--</el-row>-->
            <#--<el-row>-->
            <#--<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">-->
            <#--<el-form-item label="计划员">-->
            <#--<el-input v-model="buyer" :disabled="true"></el-input>-->
            <#--</el-form-item>-->
            <#--</el-col>-->
            <#--<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">-->
            <#--<el-form-item label="收货人联系方式">-->
            <#--<el-input v-model="consignee_information" :disabled="true"></el-input>-->
            <#--</el-form-item>-->
            <#--</el-col>-->
            <#--</el-row>-->
            <#--<el-row>-->
            <#--<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">-->
            <#--<el-form-item label="收货地址">-->
            <#--<el-input v-model="consignee_address" :disabled="true"></el-input>-->
            <#--</el-form-item>-->
            <#--</el-col>-->
            <#--<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">-->
            <#--<el-form-item label="描述">-->
            <#--<el-input v-model="remark" type="textarea" :disabled="true"></el-input>-->
            <#--</el-form-item>-->
            <#--</el-col>-->
            <#--</el-row>-->
                <br>
                <el-row>
                    <el-col>
                        <el-steps :active="1" simple>
                            <el-step title="订单明细" icon="el-icon-info" style="margin-left:-8%"></el-step>
                        </el-steps>
                    </el-col>
                </el-row>
                <br>
                <el-table :data="skuList" v-loading="tableLoading"
                          class="tb-edit"
                          style="width: 100%" size="mini"
                          tooltip-effect="dark" border :row-class-name="tableRowClassName" >
                    <el-table-column label="序号"
                                     type="index"
                                     width="50">
                    </el-table-column>
                    <el-table-column label="状态" prop="status" :show-overflow-tooltip=true :formatter="formatStatus">
                    </el-table-column>
                    <el-table-column label="订单编码" prop="surface_id" :show-overflow-tooltip=true>
                    </el-table-column>
                    <el-table-column label="材料编码" prop="sku_code" :show-overflow-tooltip=true>
                    </el-table-column>
                    <el-table-column label="材料名称" prop="sku_name" :show-overflow-tooltip=true>
                    </el-table-column>
                    <el-table-column label="品牌" prop="sku_brand" :show-overflow-tooltip=true>
                    </el-table-column>
                    <el-table-column label="单位" prop="sku_unit" :show-overflow-tooltip=true>
                    </el-table-column>
                    <el-table-column label="型号" prop="sku_model" :show-overflow-tooltip=true>
                    </el-table-column>
                    <el-table-column label="规格参数" prop="sku_slug_set" :show-overflow-tooltip=true>
                    </el-table-column>
                    <el-table-column label="单价" prop="sku_contract_price" :show-overflow-tooltip=true>
                    </el-table-column>
                    <el-table-column label="数量" prop="purNum" :show-overflow-tooltip=true>
                    </el-table-column>
                    <el-table-column label="预计到货时间" prop="arriveTime" :show-overflow-tooltip=true>
                        <template slot-scope="scope">
                            <span v-if="scope.row.arriveTime==''" style="color: #F56C6C">未填写</span>
                            <span v-else>{{scope.row.arriveTime}}</span>
                        </template>
                    </el-table-column>
                    <el-table-column label="备注" prop="sku_remark" :show-overflow-tooltip=true>
                    </el-table-column>
                </el-table>
                <br><br>
                <el-row>
                    <el-col :xs="24" :sm="16" :md="14" :lg="8" :xl="8" class="spacingFoot">
                        <el-form-item label="订单总额：">
                            <span style="color:#F56C6C;font-size: 20px">￥{{sumPrice}}</span>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-form-item>
                    <a onclick="javascript:history.back(-1);">
                        <el-button>返回</el-button>
                    </a>
                </el-form-item>
            </el-form>
        </el-main>
        <el-footer>

        </el-footer>
    </el-container>
</div>
<script src="https://pinzafile.oss-cn-shanghai.aliyuncs.com/vue-element/dist/vue.js"></script>
<script src="https://pinzafile.oss-cn-shanghai.aliyuncs.com/vue-element/lib/index.js"></script>
<script src="https://pinzafile.oss-cn-shanghai.aliyuncs.com/publiccss/assets/global/plugins/jquery.min.js"
        type="text/javascript"></script>
<script>
    new Vue({
        el: '#app',
        data() {
            return {
                tableLoading:false,
                surface_id: '${surface_id!''}',
                project_name: '${project_name!''}',
                buyer: '${buyer!''}',
                consignee_information: '${consignee_information!''}',
                consignee_address: '${consignee_address!''}',
                remark: '${remark!''}',
                crtTime: '${crtTime!''}',
                supplierContact: '${supplierContact!''}',
                organizationName: '${organizationName!''}',
                skuList: [],
                order:{},
                dataId:'',
            };
        },
        computed: {
            //计算商品总额
            sumPrice() {
                let sumPrice = 0;
                this.skuList.forEach((item) => {
                    sumPrice += Number(item.sku_contract_price) * Number(item.purNum);
                });
                sumPrice = sumPrice.toFixed(2);
                return sumPrice;
            },
        },
        methods:{
            //状态转换
            formatStatus: function (row, column) {
                return row.status == '00' ? '已上架' : row.status == '33' ? '不存在' : '已下架';
            },
            tableRowClassName({row, rowIndex}){
                if (row.status == "00") {
                    return '';
                }
                return 'danger-row';
            },
            skuInfoList(){
                this.tableLoading = true;
                $.ajax({
                    url: '/pmOrder/detailOrderSkuListByPM.json',
                    type: 'get',
                    data: {
                        dataId: this.dataId,
                        order_code:this.surface_id,
                    },
                    dataType: 'json',
                    success: (result) => {
                        this.tableLoading = false;
                        if (result.ret) {
                            console.log(result.data);
                            this.skuList = result.data;
                        } else {
                            this.$message.error('请求失败，请稍后重试');
                        }
                    }
                });
            },
        },
        mounted() {
            this.dataId='${dataId}';
            this.skuInfoList();
        }
    })
</script>
</body>

</html>